<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        canvas {
            border: 1px solid #ccc;
        }
    </style>
</head>
<body>
<canvas width="1000" height="1000"></canvas>
<script>
    var myCanvas = document.querySelector('canvas');
    var ctx = myCanvas.getContext('2d');

//    点坐标
    var coordinate = {
        x:100,
        y:100
    }

//    点尺寸
    var dottedSize = 6;

    ctx.moveTo(coordinate.x - dottedSize / 2,coordinate.y - dottedSize / 2 );
    ctx.lineTo(coordinate.x + dottedSize / 2,coordinate.y - dottedSize / 2 );
    ctx.lineTo(coordinate.x + dottedSize / 2,coordinate.y + dottedSize / 2 );
    ctx.lineTo(coordinate.x - dottedSize / 2,coordinate.y + dottedSize / 2 );
    ctx.closePath();
    ctx.fill();









</script>
</body>
</html>